import {useSelector} from "react-redux";
import CommentItem from "./commentItem";

export default function CommentList({slug}) {
    const comments = useSelector(state => state.comment);
    return (
        <div>
            {
                comments.map(comment => {
                    return (
                        <CommentItem key={comment.id} comment={comment} slug={slug}/>
                    )
                })
            }
        </div>
    )
}